package com.bruce.li.mapper;

import com.bruce.li.pojo.Sku;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SkuMapper {

    @Select("select count(*) from tb_sku;")
    int findSukTotal();

    @Select("SELECT id,name,price,num,image,update_time,category_id,category_name,brand_name,sale_num,comment_num " +
            "FROM tb_sku " +
            "LIMIT #{index},#{pageSize}")
    List<Sku> findSukByPage(@Param("index") Integer index, @Param("pageSize") Integer pageSize);

}
